//
//  JAGSplashTemplate.h
//  JAGPddAdapter
//
//  Created by Yc on 2022/12/5.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

@class JAGSplashTemplate;
@protocol JAGSplashTemplateDelegate <NSObject>
@optional
/// 开屏广告请求成功
- (void)splashTemplateAdSuccessLoad:(JAGSplashTemplate *)splashAd;
/// 开屏广告素材j加载成功
- (void)splashTemplateAdDidLoad:(JAGSplashTemplate *)splashAd;
/// 开屏广告请求失败
- (void)splashTemplateAdFailLoad:(JAGSplashTemplate *)splashAd withError:(NSError *)error;
/// 开屏广告曝光回调
- (void)splashTemplateAdExposured:(JAGSplashTemplate *)splashAd;
/// 开屏广告点击回调
- (void)splashTemplateAdClicked:(JAGSplashTemplate *)splashAd;
/// 开屏广告倒计时结束回调
- (void)splashTemplateAdCountdownToZero:(JAGSplashTemplate *)splashAd;
/// 开屏广告点击跳过回调
- (void)splashTemplateAdSkiped:(JAGSplashTemplate *)splashAd;
/// 开屏广告关闭回调
- (void)splashTemplateAdClosed:(JAGSplashTemplate *)splashAd;
/// 开屏广告关闭落地页回调
- (void)splashTemplateAdCloseLandingPage:(JAGSplashTemplate *)splashAd;

@end

typedef NS_ENUM(NSInteger,SplashType) {
    SplashType_Shake, //摇一摇
    SplashType_Slide, //滑动
    SplashType_Click, //点击
};

@interface JAGSplashTemplate : NSObject
/// 委托
@property (nonatomic, weak) id<JAGSplashTemplateDelegate> delegate;
/// 摇一摇灵敏度
@property (nonatomic ,copy) NSString  *sensitivity;
/// 当前ViewController 未赋值取 keyWindow.rootViewController
@property (nonatomic, weak) UIViewController *viewController;

/*广告数据*/
//广告类型 1.前往落地页 2.前往下载
@property (nonatomic, assign) NSInteger content_type;
//deeplink 地址
@property (nonatomic, copy) NSString *deeplink_url;
//落地页地址或应用下载地址
@property (nonatomic, copy) NSString *click_url;

/// 加载图片广告
- (void)loadAdImage:(NSString *)imageUrl;

/// 显示广告
/// @param window window
/// @param bottomView 底部视图
- (void)showAdInWindow:(UIWindow *)window withBottomView:(nullable UIView *)bottomView;

@end

NS_ASSUME_NONNULL_END
